package com.hzhjhh;

import java.sql.Connection;
import java.sql.DriverManager;

public class DBAccess {

	private static final String DRIVER =
            "com.mysql.jdbc.Driver";
    private static final String URL =
            "jdbc:mysql://localhost:3306/supermarketmanage?useSSL=false&serverTimezone=UTC";
    private static final String USER = "root";
    private static final String PASSWORD = "root";
    public static Connection getConnection() { //�������ݿ�
        Connection conn = null;
        try {
            Class.forName(DRIVER);
            conn = DriverManager.getConnection(URL, USER, PASSWORD);

        } catch (Exception ex) {
            ex.printStackTrace();
        }
        return conn;
    }

}
